﻿@using Kendo.Mvc.UI;
@{
    Layout = null; 
}
@model TS2015.Models.TbThiSinh

<div class="panel-body">
    <div id="xettuyenDH">
        <h2 style="text-align:center; margin-bottom:50px">ĐĂNG KÝ HỒ SƠ XÉT TUYỂN KẾT QUẢ THI TN THPT DO CÁC TRƯỜNG ĐH TỔ CHỨC</h2>
        <div class="form-group">
            <div class="col-lg-6 col-md-6">
                <div class="row"><label>1. Trường thi:</label></div>
                <div class="col-lg-8 col-md-8">
                    <div class="row">
                        @Html.DropDownListFor(m => m.MaTruongDH, (SelectList)ViewBag.TruongDH, "Chọn trường Đại học...", new { @class = "form-control" })
                        @*@Html.ValidationMessageFor(model => model.MaTruongDH)*@
                    </div>
                </div>
            </div>
        </div>
        <div style="clear:both"></div>
        <div class="form-group">
            <strong>2. Điểm Tốt nghiệp :</strong><br />
            <div class="col-md-4">
                <div class="col-md-3">
                    <div class="row row-top-label"><strong>Điểm Toán: </strong></div>
                </div>
                <div class="col-md-2">
                    <div class="row row-top-input">
                        @Html.TextBox("MarkRecruitment", "", new { @class = "input-text" })
                        <input type="text" name="SubjectRecruitment" class="hide" value="Toán" />
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="col-md-5">
                    <div class="row row-top-label"><strong>Điểm Tiếng Anh: </strong></div>
                </div>
                <div class="col-md-2">
                    <div class="row row-top-input">
                        @Html.TextBox("MarkRecruitment", "", new { @class = "input-text" })
                        <input type="text" name="SubjectRecruitment" class="hide" value="Tiếng anh" />
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="col-md-5">
                    <div class="row row-top-label"><strong>Điểm Ngữ Văn: </strong></div>
                </div>
                <div class="col-md-2">
                    <div class="row row-top-input">
                        @Html.TextBox("MarkRecruitment", "", new { @class = "input-text" })
                        <input type="text" name="SubjectRecruitment" class="hide" value="Ngữ văn" />
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-6 col-md-6">
                <strong>Điểm môn tự chọn :</strong><br />
                <div class="col-lg-8 col-md-8">
                    <div class="row">
                        @Html.DropDownList("ddlSubjectRecruitment", (SelectList)ViewBag.MonTotNghiep, "Chọn Môn...", new { @class = "form-control form-shortcontrol", id = "SubjectCustomID" })
                        @*<span class="field-validation-valid" data-valmsg-for="ddlSubjectRecruitment" data-valmsg-replace="true"></span>*@
                    </div>
                </div>
                <div class="col-lg-1 col-md-1">
                    <div class="row">
                        @Html.TextBox("ddlMarkRecruitment", "", new { @class = "input-text" })
                    </div>
                </div>
            </div>
        </div>
        <div style="clear:both"></div> 
        <div class="form-group">
            <strong>3. Đăng ký dự thi : </strong><br />
            <div class="col-lg-6 col-md-6">
                <div class="col-lg-8 col-md-8">
                    <div class="row">
                        <strong>Hệ đào tạo:</strong>
                        @Html.DropDownList("HDT", (SelectList)ViewBag.HeDaoTao, "Chọn Hệ đào tạo...", new { @class = "form-control valid", data_val = "true", data_val_required = " ", aria_required = "true", aria_describedby = "HDT-error HDT-error HDT-error", id = "TrainingSystemID3" })
                        @Html.ValidationMessage("HDT")
                        @*<span class="field-validation-valid" data-valmsg-for="HDT" data-valmsg-replace="true"></span>*@
                        <br />
                        <strong>Ngành : </strong>
                        @*@if (Model.MaTS != null)
                        {
                            @Html.DropDownList("MaNganh", (SelectList)ViewBag.Nganh, "Chọn Ngành...", new { @class = "form-control valid", id = "PhylumID", data_val = "true", aria_required = "true", data_val_required = " ", aria_describedby = "MaNganh-error MaNganh-error MaNganh-error" })
                        }
                        else
                        {*@
                        @Html.DropDownList("MaNganh", new SelectList(Enumerable.Empty<SelectListItem>()), "Chọn Ngành...", new { @class = "form-control valid", id = "PhylumID3", data_val = "true", data_val_required = " ", aria_required = "true", aria_describedby = "MaNganh-error MaNganh-error MaNganh-error" })
                        @*}*@
                        <span class="field-validation-valid" data-valmsg-for="MaNganh" data-valmsg-replace="true"></span>
                    </div>
                </div>
            </div>
            <div class="col-lg-6 col-md-6">
                <div class="col-lg-8 col-md-8">
                    <div class="row">
                        <strong>Khối thi: </strong>
                        @Html.DropDownList("MaKhoiThi", (SelectList)ViewBag.KhoiThi, "Chọn Khối thi...", new { @class = "form-control valid", data_val = "true", data_val_required = " ", aria_required = "true", aria_describedby = "MaKhoiThi-error MaKhoiThi-error MaKhoiThi-error", id = "GroupID3" })
                        <span class="field-validation-valid" data-valmsg-for="MaKhoiThi" data-valmsg-replace="true"></span>
                        <br />
                        <strong>Chuyên ngành : </strong>
                        @*@if (Model.MaChuyenNganh != null)
                        {
                            @Html.DropDownListFor(m => m.MaChuyenNganh, (SelectList)ViewBag.ChuyenNganh, "Chọn Chuyên ngành...", new { @class = "form-control", id = "MajorID" })
                        }
                        else
                        {*@
                        @Html.DropDownListFor(m => m.MaChuyenNganh, new SelectList(Enumerable.Empty<SelectListItem>(), "MaChuyenNganh", "TenChuyenNganh"), "Chọn Chuyên ngành...", new { @class = "form-control", id = "MajorID3" })
                        @*}*@
                        @Html.ValidationMessageFor(model => model.MaChuyenNganh)
                    </div>
                </div>

            </div>
        </div>
        <div style="clear:both"></div>
        <div class="form-group" id="swap4">
            <div class="col-lg-6 col-md-6">
                <div class="row">
                    <strong>4. Điểm các môn còn lại trong khối :</strong>
                </div>
                <div id="lbMonTrongKhoi"></div>
                <div id="txtMonTrongKhoi"></div>
            </div>
        </div>
        <div style="clear:both"></div>
    </div>
</div>
<script type="text/javascript">
    var dulieu;
    // University
    $("form").removeData("validator");
    $("form").removeData("unobtrusiveValidation");
    $.validator.unobtrusive.parse("form");
    $(document).ready(function () {

        // Step2_Examination
        $("#TrainingSystemID3").change(function () {
            var TSID = $(this).val();
            $("#GroupID3").change(function () {
                $("#PhylumID3").html('').append($('<option/>', {
                    value: 0,
                    text: "Chọn Ngành..."
                }));
                var groupid = $(this).val();
                $.getJSON("/Common/GetPhylumByGroup", { HDT: TSID, makhoithi: groupid },
                        function (data) {
                            var select = $("#PhylumID3");
                            select.empty();
                            select.append($('<option/>', {
                                value: 0,
                                text: "Chọn Ngành..."
                            }));
                            $.each(data, function (index, itemData) {
                                select.append($('<option/>', {
                                    value: itemData.Value,
                                    text: itemData.Text
                                }));
                            });
                        });
            });
        });
        $("#PhylumID3").change(function () {
            var phylumid = $(this).val();
            $("#MajorID3").html('').append($('<option/>', {
                value: 0,
                text: "Chọn Chuyên ngành..."
            }));
            $.getJSON("/Common/GetMajorByPhylum", { manganh: phylumid },
                   function (data) {
                       var select = $("#MajorID3");
                       select.empty();
                       select.append($('<option/>', {
                           value: 0,
                           text: "Chọn Chuyên ngành..."
                       }));
                       $.each(data, function (index, itemData) {
                           select.append($('<option/>', {
                               value: itemData.Value,
                               text: itemData.Text
                           }));
                       });
                   });
        });
        $("#SubjectCustomID").change(function () {
            var graduatesubjectid = $(this).val();
            $("#lbMonTrongKhoi").html('')
            $.getJSON("/RegistrationManagement/GetGraduateSubject",
                function (data1) {
                    var select1 = $("#MonTuyChon");
                    select1.empty();
                    $.each(data1, function (index1, itemData1) {
                        //select.append('<div class="col-lg-4 col-md-4"><div class="col-lg-6 col-md-6"><div class="row row-top-label"><strong>  ' + itemData.Text + ': </strong></div></div><div class="col-lg-4 col-md-4"><div class="row row-top-input"><input type="text" class="input-text"/><br/></div></div></div>');
                        select1.append('<label style="padding-right:5px">  ' + itemData1.value + ': </label>');
                    });
                });
            //$("#MonTuChon").text(graduatesubjectid)
            $.getJSON("/Common/GetGraduateSubjectBySubjectCustom", { mamon: graduatesubjectid },
                   function (data) {
                       var select = $("#lbMonTrongKhoi");
                       select.empty();
                       $.each(data, function (index, itemData) {
                           select.append('<div class="col-lg-4 col-md-4"><div class="col-lg-7 col-md-7"><div class="row row-top-label"><strong>  ' + itemData.Text + ': </strong></div></div><div class="col-lg-4 col-md-4"><div class="row row-top-input"><input type="text" class="input-text"/></div></div></div><br/><div style="clear:both"></div>');

                       });
                   });
        });
        $("#GroupID3").change(function () {
            var subjectid = $(this).val();
            //$("#lbMonThiThem").html('')
            var graduatesubjectid = $("#SubjectCustomID").val();
            $.getJSON("/Common/GetGraduateSubjectByGroup", { mamontuychon: graduatesubjectid, makhoithi: subjectid },
                   function (data) {
                       dulieu = data;
                       var select = $("#lbMonTrongKhoi");
                       select.empty();
                       $.each(data, function (index, itemData) {
                           select.append('<div class="col-lg-4 col-md-4"><div class="col-lg-7 col-md-7"><div class="row row-top-label"><strong>  ' + itemData.TenMon + ': </strong></div></div><div class="col-lg-4 col-md-4"><div class="row row-top-input"><input type="text" name="MarkSubject" class="input-text"/><input type="text" name="IDInput" class="hide" value="' + itemData.MaMon + '"/></div></div></div><br/><div style="clear:both"></div>');

                       });
                   });
        });
    });
</script>